#!/bin/bash
echo `date`
echo ' check_mysql.sh start'

function check(){
    process_name="per5"

    # 指定要查询和杀死的进程名称
    pid=`ps -ef | grep $process_name | grep -v grep | awk '{print $2}'`

    if [ -z "$pid" ]; then
        echo "No process found with name $process_name"
    else
        # 杀死进程
        echo "success"
        kill $pid
    fi
}

check

function check2(){
    process_name="per15"

    # 指定要查询和杀死的进程名称
    pid=`ps -ef | grep $process_name | grep -v grep | awk '{print $2}'`

    if [ -z "$pid" ]; then
        echo "No process found with name $process_name"
    else
        # 杀死进程
        echo "success"
        kill $pid
    fi
}

check2

function check3(){
    process_name="import_dfcf_hy_money"

    # 指定要查询和杀死的进程名称
    pid=`ps -ef | grep $process_name | grep -v grep | awk '{print $2}'`

    if [ -z "$pid" ]; then
        echo "No process found with name $process_name"
    else
        # 杀死进程
        echo "success"
        kill $pid
    fi
}

check3

function check5(){
    process_name="set_zhangting_cache"

    # 指定要查询和杀死的进程名称
    pid=`ps -ef | grep $process_name | grep -v grep | awk '{print $2}'`

    if [ -z "$pid" ]; then
        echo "No process found with name $process_name"
    else
        # 杀死进程
        echo "success"
        kill $pid
    fi
}

check5

function check6(){
    process_name="set_minite_cache"

    # 指定要查询和杀死的进程名称
    pid=`ps -ef | grep $process_name | grep -v grep | awk '{print $2}'`

    if [ -z "$pid" ]; then
        echo "No process found with name $process_name"
    else
        # 杀死进程
        echo "success"
        kill $pid
    fi
}

check6

function check7(){
    process_name="exec_zhangting_monitor.py"

    # 指定要查询和杀死的进程名称
    pid=`ps -ef | grep $process_name | grep -v grep | awk '{print $2}'`

    if [ -z "$pid" ]; then
        echo "No process found with name $process_name"
    else
        # 杀死进程
        echo "success"
        kill $pid
    fi
}

check7

echo 'end'
